<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CMPI Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">CMPI Instruction<BR>
<hr noshade></h1>
<BR>
<span class="text">CMPI (CoMPare Immediate) compares an immediate value with an effective address The flags are affected the same way as if the effective address was subtracted from the data register. None of the operands are changed. Often used with the Bcc instruction. An example:<BR>
<BR>
CMP #&lt;data&gt;,D0<BR>
BGT X1<BR>
<BR>
The program will branch to X1 if D0 is greater than the immediate value.<BR>
<BR>
ADDRESS METHODS: Dn, (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l<BR>
<BR>
DATA LENGTH: Byte, word, longword</span>
          <TABLE border=0 cellPadding=0 cellSpacing=0 width="67%">
  <TBODY>
    <TR>
      <TD width="15%" rowSpan=5 vAlign=top class="text">FLAGS:</TD>
      <TD width="85%" class="text">X - U</TD>
    </TR>
    <TR>
      <TD width="85%" class="text">N - S</TD>
    </TR>
    <TR>
      <TD width="85%" class="text">Z - S</TD>
    </TR>
    <TR>
      <TD width="85%" class="text">C - Set if a borrow was needed when subtracting, otherwise it is cleared.</TD>
    </TR>
    <TR>
      <TD width="85%" class="text">V - S</TD>
    </TR>
  </TBODY>
</TABLE>
<P><span class="text">SYNTAX: CMPI &lt;ea&gt;,Dn<BR>
      <BR>
  There are four CMP instructions, CMP, CMPA, CMPI and CMPM. The compiler often chooses the right instruction, so you can write CMP all the time if you want.<BR>
</span></P>
<span class="text">
</span>
</body>
</html>
